package com.cskaoyan.mapper;

import com.cskaoyan.bean.pojo.MallCoupon;
import com.cskaoyan.bean.pojo.MallCouponExample;
import com.cskaoyan.bean.vo.CouponpartInfoVO;
import com.cskaoyan.bean.vo.StartandEndTimeVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MallCouponMapper {
    long countByExample(MallCouponExample example);

    int deleteByExample(MallCouponExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MallCoupon record);

    int insertSelective(MallCoupon record);

    List<MallCoupon> selectByExample(MallCouponExample example);

    MallCoupon selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MallCoupon record, @Param("example") MallCouponExample example);

    int updateByExample(@Param("record") MallCoupon record, @Param("example") MallCouponExample example);

    int updateByPrimaryKeySelective(MallCoupon record);

    int updateByPrimaryKey(MallCoupon record);

    List<Integer> selectCouponId();

    StartandEndTimeVO selectStartandEndTime(Integer couponId);

    List<MallCoupon> selectByUserCouponUnUsedId(@Param("userids") List<Integer> userids);

    MallCoupon selectbyCode(String code);

    int selectCountId(String code);

    int selecttotalbyId(Integer id);

    void updatetotalById(@Param("id") Integer id, @Param("amount") int amount);

    MallCoupon selectbyCouponId(int couponId);


    void updatestatusById(Integer id);

    BigDecimal selectPricebyCouponId(Integer couponId);

    List<MallCoupon> selectCouponUnlogin();

    CouponpartInfoVO getLimitandtotalandstatus(Integer couponid);
}